<?php
class PartnerModel
{
	static private $_tableName = 'partner'; 
	
	static public function getTableName()
	{
		return self::$_tableName;
	}
	
	static public function getAll()
	{
		$result = array();
		$sql = 'SELECT * FROM '.self::getTableName();
		$result = DB::fetchAll($sql);
		return $result;
	}
	
	static public function insert($params)
	{
		$sql = 'INSERT INTO '.self::getTableName() .' (name,partner_type_id,username,password,web,tel,address,operating_time) VALUES (:name,:partner_type_id,:username,:password,:web,:tel,:address,:operating_time)';
		$data = array(
			'name' => $params['name'],
			'partner_type_id' => $params['partner_type_id'],
			'username' => $params['username'],
			'password' => $params['password'],
			'web' => $params['web'],
			'tel' => $params['tel'],
			'address' => $params['address'],
			'operating_time' => $params['operating_time'],
		);
		$result = DB::insert($sql, $data);
		return $result;
	}
	
	
}